#include "HeadFile.h"

Factory* Factory::instance = nullptr;
Factory::Factory()
{
}


Factory::~Factory()
{
}

BaseWindow * Factory::FCreateWindow(WindowType type, bool flag2 = false, UserNode* uptr = nullptr)
{
	if (type == WMainMenu) {
		return new MainMenu();
	}
	else if (type == WControlMenu) {
		return new ControlMenu();
	}
	else if (type == WCheckAllUser) {
		return new CheckAllUser();
	}
	else if (type == WCheckTheUser) {
		return new CheckTheUser(uptr);
	}
	else if (type == WInsertAUser) {
		return new InsertAUser;
	}
	else if (type == WDeleteTheUser) {
		return new DeleteTheUser(flag2);
	}
	else
		return new MainMenu;
}

Factory * Factory::Instance()
{
	if (instance == nullptr)
	{
		instance = new Factory;
	}
	return instance;
}
